﻿using TaoSH.AppCode;
using TaoSH.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TaoSH.View
{
    public partial class SPZXGL : FormUControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        /// <summary>
        /// 重写父类的保存数据方法
        /// </summary>
        /// <param name="intFormID">数据ID</param>
        /// <param name="strActionType">操作类型("ADD":"添加","UPDATE":"修改")</param>
        /// <returns></returns>
        public override bool SaveForm(int intFormID, string strActionType)
        {
            //执行 父类的方法
            base.SaveForm(intFormID, strActionType);


            //保存数据
            PT_Pro_Ask Model = new PT_Pro_AskB().GetEntity(d => d.ID == intFormID);
            Model.Answer = txtWTContent.Text;
            Model.AnswerUser = UserInfo.User.UserName;
            Model.AnswerTime = DateTime.Now;
            return new PT_Pro_AskB().Update(Model);
        }




        public override void initMangerForm(int intFormID)
        {
            base.initMangerForm(intFormID);
            PT_Pro_Ask Model = new PT_Pro_AskB().GetEntity(d => d.ID == intFormID);
            txtWTTitle.Text = Model.Question;
            txtWTContent.Text = Model.Answer;
        }


    }
}